From 4535b2301dd123b8faf1b2110401017434f6b9bb Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 19 Jan 2011 15:29:04 +0000 Subject: [PATCH] x86_emulate: set the operand size for SMSW/reg writeback. Otherwise it defaults to 0 bytes. Signed-off-by: Tim Deegan Signed-off-by: Keir Fraser --- xen/arch/x86/x86_emulate/x86_emulate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index d6586d6944..186cef2b9b 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -3555,8 +3555,7 @@ x86_emulate( goto done; break; case 4: /* smsw */ - if ( ea.type == OP_MEM ) - ea.bytes = 2; + ea.bytes = (ea.type == OP_MEM) ? 2 : op_bytes; dst = ea; fail_if(ops->read_cr == NULL); if ( (rc = ops->read_cr(0, &dst.val, ctxt)) ) -- 2.30.2